Notes for fixes done to Psychonauts.

1) Change Properties of .exe to be Win95 compatible, if necessary.  This fixes assorted crashes that happen during cut scenes.

2) Profile to use.
New driver, 314.22 WHQL, does have a Psychonauts profile, but it is empty.  Older driver had comments, and was rated as excellent.  Worse, this new profile actually breaks the game by making the halo effect when selecting characters double up.
Deleting the profile with NVidia Inspector fixes that haloing of selection, and fixes some lights.  Changing to Aion profile also seems to work, but doesn't seem any different than the global default profile.
Since we were using Aion profile before, we'll continue to use it now, as one less step if you haven't changed drivers.

3) Helix debugger version.
No version numbers in d3d9.  Using 224K version, included.

4) Skybox shader 33 modified to push Z out 8000.  Converted to vs_3_0 so that we can use if_eq, and texture list in DX9Settings.ini to *only* change the ones related to the sky and sun.  This avoids glitching the cabin floors and lamps and anything else I might have missed.

5) Skybox shader 66, below mountain level is modified to push Z out 8000.  Converted to vs_3_0 so we can use if_eq, because the same shader is used in other locations in game.
Also push it up by 40000 in the Y axis, which is *up* at that point I think.  This closes the gap between 66 and 33, and fixes the tear/gap in the skybox.

6) Add 3 shaders for the main load/splash screen.  Three layers of moving images that would move in to close when convergence was turned up high. These shaders are also used in the Collective Unconscious, so I made them work with proper textures in both places.

7) City skyline in Coach's brain.  This is shader 59, and needed to be converted to vs_3_0 to be able to use if_eq statement to filter on proper texture.  Filtered on 6 textures, and looks great.  

8) Created a mechanism to allow me to find stray textures using hot-pink color for ones that are missing.  This can be disabled or enabled in the ini file.  I've left it enabled here as a debugging example.  
Use Numberpad period key to disable the fixes to shaders and see how it looks unfixed.  Use Numberpad zero key to toggle pink effect on, to see shaders that are not in the fix lists. Use Numberpad Enter key to set things to default fixed and no pinking.

9) Sky in Coach's Brain at Cannon round.  Near punch game.  Fixes for both skybox and the moon.

10) Sky in Coach's Brain near warships.  Fixes for sky, sun, and the horizon style haze.

11) Sasha's Shooting Gallery had similar problems with skybox, updated textures to push clouds and psychadelic sky images to depth.


//-----------------------------------------------------------------
// DX9Settings.ini
//-----------------------------------------------------------------

[General]
DumpAll = true
DefVSConst1 = 250
Preset1Key = 13
Preset2Key = 110
Preset3Key = 96

// The normal On settings for fixes.
// Compare if_eq.x to 666 in shader for on, 999 for off.
// Compare if_eq.y to 666 in shader for pink, 999 for off.
[Preset1]
	Const1 = 0x44268000
	Const2 = 0x4479c000
	UseByDef = true
	
// fix off
[Preset2]
	Const1 = 0x4479c000

// pinking on
[Preset3]
	Const2 = 0x44268000


//-------------------------- Cabins ---------------------------------------

// [VS29638A74] Shader 33, sky dome
// Mod:
//  9E7D8DA0;  Skybox clouds Layer 1 
//  7E278589;  Skybox clouds Layer 2 
//  0DE06395;  Sun
//  EA93BB61;  Moon in Coach's Brain 
//  2FEFB366;  Moon out door of plane in Coach's Brain
// No mod:
//  FEB6B180;  Cabin floors  
//  CD6C7435;  Lamppost 
//  Unknown FF000000;
//  Unknown ABAE44A1;
//  6917ACAC;  Flashing red light in plane

[VS29638A74]
CheckTexCRC = true
DefinedTexturesVS = EA93BB61;0DE06395;9E7D8DA0;7E278589;2FEFB366;
TexCounterReg = 251
ValForDefined = 666
ValNotDefined = 999


// [VS25BC27CC] Shader 66, skydome below mountain
// Mod:
//  9B5F02CC;  Band of sky below mountain tops
//  9967B80B;  Camo skybox in Coach's brain
// No Mod:
//  1C3D546E;  Sky reflection in lake
//  8AF4FADD;  Fog in valley below cabins

[VS25BC27CC]
CheckTexCRC = true
DefinedTexturesVS = 9B5F02CC;9967B80B;
TexCounterReg = 251
ValForDefined = 666
ValNotDefined = 999

//-------------------------- Coach's Brain, Trenches ---------------------------------------

// [VSDEC13C78] Shader 59, city skyline, tree canopies
//
// Coach's Brain:
//  Mod:
//   C119CA38;  City skyline in distance
//   2735EC4E;  Far sky, past clouds
//   027DFA6A;  Bottom 'bowl' of skybox 
//   6445DE5C;  City street map at far bottom
//   06E679DB;  Skybox top half in airplane
//   6BC35B6A;  Skybox bottom half in airplane
//  No Mod:
//   89A5A855;  Rings on wall near trampoline
//   73671DA6;  Mines on ground
//
// Cabins:
//  No Mod:
//   AB97A5C4;  Random trees on hillsides
//   196D0136;  Tree trunsk in camp
//   D84A182D;  Tree crowns in camp
//   DE8FE236;
//   E506C7FE;
//   75A13130;
//   7DC2EC8F;
//   25CFCE9E;
//   8F797E4C;
//   F3048EB2;
//   A8010F3B;
//   ED001448;
//   1BB73819;
//   DB53F4CA;
//   2A233E81;
//   1EB9A462;
//   4B8390C1;  Mountain Range past lake
//   304D7202;
//   FF000000;
//   64B7226B;
//   8D7FCA28;
//   FEB6B180;
//   E10B9C65;
//   86ECFFB0;
//   83E5B2CE;
//   93F9AD36;
//   82260914; 
//   0ADF3508; 
//   7BEAC660; 
//   D0CB0AE1; 
//   44770942; 
//   A4A3A1A5; 
//   9ABD9FE4; 
//   EFC83432; 
//   53CC5E42;  Roof of main lodge

[VSDEC13C78]
CheckTexCRC = true
DefinedTexturesVS = C119CA38;2735EC4E;027DFA6A;6445DE5C;06E679DB;6BC35B6A;
TexCounterReg = 251
ValForDefined = 666
ValNotDefined = 999


//-------------------------- Coach's Brain,  ---------------------------------------

// [VSA5F81EB7] Sky in Coach's Brain by punch game.
// Mod:
//  1326313C;  Camo pattern on the sky
//  8E0DEEB7;  Camo pattern on the sky near boats
// No Mod:
//  27782283;  Stream of fog over ship bow

[VSA5F81EB7]
CheckTexCRC = true
DefinedTexturesVS = 1326313C;8E0DEEB7;
TexCounterReg = 251
ValForDefined = 666
ValNotDefined = 999

//--------------------------
// [VSFE2D73C7] Shader 11 Coach's Brain punch game
// Mod:
//   2FEFB366;  Moon near punch game
//   1496134E;  Sun in boat round
// No Mod:
//   FF000000;  Background of sky camoflauge pattern
//   6F7B94CA;  Piece of background sky behind camoflauge pattern
//   FF000000;  Spotlights around punch game?
//   9C29A9AA;  Coach movie on wall in punch game
//   B3638961;  Guitar figment outside gate
//   6DF07E7F;  Figments outside gate
//   E19B1CC0;  Duck Figments near punch game
//   CE67D2D4;  Figments near punch game
//   744F59FC;  Movie projection in boat round
//   01084115; unknown
//   7E7FCFF6; unknown
//   775AFBD3; unknown
//   629BC53B; unknown
//   88851049; unknown
//   426B6B4B; unknown
//   B2ADB0B8; unknown
//   1E62D0F9; unknown
//   8BC7C0AD; sky?
//   FA3DA068; unknown
//   A856DEAB; unknown
//   179D9C5B; unknown
//   4BB82F05; unknown
//   09C4AA38; unknown
//   DC1A4088; unknown
//   F8E0B9C2; unknown
//   271ECDFF; unknown
//   42C23FDC; unknown
//   33862BD2;  sky box behind camoflauge pattern
//   A4771E14;  sky box behind camoflauge pattern
//   F4DEC888; unknown
//   E42C88BF; unknown
//   662CF73E; unknown
//   1907A231; unknown

[VSFE2D73C7]
CheckTexCRC = true
DefinedTexturesVS = 2FEFB366;1496134E;
TexCounterReg = 251
ValForDefined = 666
ValNotDefined = 999

//--------------------------
// [VSE29CD258] Haze on horizon in Coach's Brain by warships.
//		similar to cityscape in first round
// Mod:
//   92EFCDAF;  Haze/fog on horizon

[VSE29CD25B]
CheckTexCRC = true
DefinedTexturesVS = 92EFCDAF;
TexCounterReg = 251
ValForDefined = 666
ValNotDefined = 999
